package com.jlsoft.web.user;

import com.jlsoft.config.SimpleResponse;
import com.jlsoft.web.user.service.IUserManagerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.context.request.ServletWebRequest;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 陈喜东
 * @since 2018-02-12
 */
@RestController
@RequestMapping("/user")
public class UserController {

	@GetMapping("/list")
	public SimpleResponse findAllUser(HttpServletRequest request, HttpServletResponse response) {
		ServletWebRequest webRequest = new ServletWebRequest(request, response);

		return new SimpleResponse(0, userManagerService.find_user_list(webRequest), true);
	}


    @RequestMapping("")
    public String pageInit(){
        return "user page";
    }

    @Autowired
	private IUserManagerService userManagerService;
}
